perf(root-search): precompile command scoring fields#557
Closed
JustYannicc wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
rankCommands' existing score/order contract while exposing indexed match metadata for root command candidates.useLauncherCommandModelfor active root command search, recomputing when the searchable command snapshot or aliases change.scripts/test-root-search-perf.mjsto assert exact root command signatures and report legacy, compatibility-wrapper, indexed, and compile timings.Why
Root command ranking was rebuilding scoring fields and normalized forms for every command on every query. The indexed path moves that work to a command/alias snapshot compile step and keeps per-keystroke ranking focused on the query and precompiled field data.
Compatibility impact
rankCommands(commands, query, aliases)still returns the public{ command, score }shape and preserves the existing ranking weights, alias exact sorting, always-on-top handling, and title tie-breaks.useLauncherCommandModelalready used formatchKindandmatchScore.How tested
node scripts/test-root-search-ranking.mjs✅node scripts/test-root-search-perf.mjs✅1567.54msfor 6000 commands / 8 queries.105.51ms, index compile median77.94ms.2357.29ms, compatibility-wrapper median936.64ms, and legacy-vs-indexed speedup22.34x.git diff --check✅./node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit --pretty false❌ existing renderer typecheck failures onorigin/mainremain outside this change, including existing errors inApp.tsx,CameraExtension.tsx,LiquidGlassSurface.tsx, browser profile typing inuseLauncherCommandModel.ts, and several Raycast runtime/settings files.Stack validation
origin/main(9bdd3d2).